﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"><title>后台登录</title>
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../../Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#TB_Login").live('click', function () {
            var name = $("#TB_Name").val();
            var pwd = $("#TB_Pwd").val();
            $.ajax({
                url: "MyLogin",
                data: "name=" + name + "&pwd=" + pwd,
                success: function (data) {
                    if (data == "Error") {
                        alert("用户名/密码或验证码输入错误,请重新登录!");
                        return;
                    }
                    else {
                        document.location("BackMain");
                    }
                },
                error: function (jqXHR) {
                    alert("用户名/密码输入错误,请重新登录!");
                }
            });
        })
    });
</script>
<body>
    <div style="width: 100%; text-align: center; font-size: 20px; margin: auto;">
        <table style="margin-top: 200px; border: 0px solid Blue; text-align: center; border-collapse: collapse;" cellspacing="1" cellpadding="1" width="100%">
            <tr>
                <td style="text-align: right; width: 50%">用户名：</td>
                <td style="text-align: left">
                    <input id="TB_Name" type="text" name="name" value="admin" /></td>
            </tr>
            <tr>
                <td style="text-align: right; width: 50%">密&nbsp;&nbsp;&nbsp;码：</td>
                <td style="text-align: left">
                    <input id="TB_Pwd" type="password" name="pwd" value="admin" /></td>
            </tr>
            <tr>
                <td colspan="2" style="height: 30px;"></td>
            </tr>
            <tr style="width: 100%">
                <td colspan="2" style="text-align: center; margin: auto">
                    <input id="TB_Login" type="submit" name="TB_Login" value="登录" class="btn" /></td>
            </tr>
        </table>
    </div>
</body>
</html>
